<?php

/**
 * sfGuardRegisterForm for registering new users
 *
 * @package    sfDoctrineGuardPlugin
 * @subpackage form
 * @author     Jonathan H. Wage <jonwage@gmail.com>
 * @version    SVN: $Id: BasesfGuardChangeUserPasswordForm.class.php 23536 2009-11-02 21:41:21Z Kris.Wallsmith $
 */
class sfGuardRegisterForm extends BasesfGuardRegisterForm {

    /**
     * @see sfForm
     */
    public function configure() {





            
        
        $this->widgetSchema['email_address']=new sfWidgetFormInputText();
        
        $this->validatorSchema['email_address']= new sfValidatorEmail();
        
        $university = new sfWidgetFormDoctrineJQueryAutocompleter(array(
                    'url' => sfContext::getInstance()->getRouting()->generate("auto_complete_university"),
                    'model' => 'University',
                ));

        $this->setWidget('university_id', $university);


        $faculty = new sfWidgetFormDoctrineJQueryAutocompleter(array(
                    'url' => sfContext::getInstance()->getRouting()->generate("auto_complete_faculty"),
                    'model' => 'Faculty',
                    'config' => "{extraParams:{uni_id: function() { return $('#sf_guard_user_university_id').val(); } }}",
                ));
        $this->setWidget('faculty_id', $faculty);
    }

}